package com.doublefish.doublefishrobot.ui.setting;

import android.widget.TextView;

import com.doublefish.doublefishrobot.R;
import com.doublefish.doublefishrobot.base.BaseActivity;
import com.doublefish.doublefishrobot.ui.setting.widget.HandSwitchView;
import com.doublefish.doublefishrobot.utils.AppCacheUtil;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * 作者:dugaofeng on 2024/10/16 10:04
 */
public class HandSwitchActivity extends BaseActivity {


    @BindView(R.id.tv_title)
    TextView titleTV;

    @BindView(R.id.switchbtn)
    HandSwitchView handSwitchView;


    @Override
    protected int getLayoutId() {
        return R.layout.activity_hand;
    }

    @Override
    protected void initData() {
        int tag = AppCacheUtil.getInstance().getHandTag();
        handSwitchView.setSelectIndex(tag, false);
    }

    @Override
    protected void initView() {
        titleTV.setText(R.string.hand_type);
    }

    @Override
    protected void initListener() {
        handSwitchView.setOnHandSwitchViewListner(new HandSwitchView.OnHandSwitchViewListner() {
            @Override
            public void onHandSwitchViewChanged(int index) {
                AppCacheUtil.getInstance().setHandTag(index);
            }
        });
    }

    @OnClick(R.id.ll_back)
    public void onBackClick() {
        finish();
    }
}
